<template>
  <div class="hello">
    <h1>{{ msg }}</h1>
    <h1>{{props.islogin?"已登录":"未登录"}}</h1>
    <ul>
      <li v-for="(item,index) in props.list" :key="index">
      {{item}}
      </li>
    </ul>
    
  </div>
</template>

<script setup>
import {defineProps,ref} from "vue"
import {onMounted} from "vue"
import bus from "@/utils/bus.js"

const props = defineProps({
  islogin:Boolean,
  list:Array,
})
onMounted(()=>{
  bus.on('msg',(msg)=>{
    console.log(msg) //
    console.log(msg.value) //接收的数据的值
  

  })
})



let msg = ref('哈哈哈')





</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>

</style>
